# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import datetime
from django.conf import settings


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Agreement',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('number', models.CharField(unique=True, max_length=255, verbose_name='\u041d\u043e\u043c\u0435\u0440')),
                ('address', models.TextField(verbose_name='\u0410\u0434\u0440\u0435\u0441')),
            ],
            options={
                'verbose_name': '\u0414\u043e\u0433\u043e\u0432\u043e\u0440',
                'verbose_name_plural': '\u0414\u043e\u0433\u043e\u0432\u043e\u0440\u044b',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=256, verbose_name='\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435')),
                ('type', models.CharField(blank=True, max_length=1, verbose_name='\u0422\u0438\u043f', choices=[('I', '\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u0438\u0446\u043e'), ('L', '\u042e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043b\u0438\u0446\u043e')])),
                ('passeria', models.CharField(max_length=12, verbose_name='\u0421\u0435\u0440\u0438\u044f \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430', blank=True)),
                ('pasnomer', models.CharField(max_length=12, verbose_name='\u041d\u043e\u043c\u0435\u0440 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0430', blank=True)),
                ('paspodrazdelenie', models.CharField(max_length=12, verbose_name='\u041a\u043e\u0434 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f', blank=True)),
                ('pasdate', models.DateField(null=True, verbose_name='\u0414\u0430\u0442\u0430 \u0432\u044b\u0434\u0430\u0447\u0438', blank=True)),
                ('address', models.TextField(verbose_name='\u0410\u0434\u0440\u0435\u0441 \u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u0443\u0433')),
                ('phone', models.CharField(max_length=32, verbose_name='\u0422\u0435\u043b\u0435\u0444\u043e\u043d')),
                ('email', models.EmailField(max_length=75, verbose_name='E-mail', blank=True)),
                ('comments', models.TextField(verbose_name='\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439', blank=True)),
                ('inn', models.CharField(max_length=b'12', verbose_name='\u0418\u041d\u041d', blank=True)),
            ],
            options={
                'verbose_name': '\u041a\u043b\u0438\u0435\u043d\u0442',
                'verbose_name_plural': '\u041a\u043b\u0438\u0435\u043d\u0442\u044b',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ConnectionType',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('title', models.CharField(max_length=255, verbose_name='\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435')),
                ('connect', models.TextField(verbose_name='\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435')),
                ('disconnect', models.TextField(verbose_name='\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435')),
                ('block', models.TextField(verbose_name='\u0411\u043b\u043e\u043a')),
                ('activate', models.TextField(verbose_name='\u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f')),
            ],
            options={
                'verbose_name': '\u0422\u0438\u043f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f',
                'verbose_name_plural': '\u0422\u0438\u043f\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Operation',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=50, verbose_name='\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435')),
                ('amount', models.DecimalField(verbose_name='\u0421\u0443\u043c\u043c\u0430', max_digits=19, decimal_places=2)),
                ('agreement_number', models.CharField(max_length=20, null=True, editable=False)),
                ('date', models.DateTimeField(default=datetime.datetime.now, verbose_name='\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f')),
                ('payment_id', models.IntegerField(null=True)),
                ('agreement', models.ForeignKey(related_name='operations', verbose_name='\u0414\u043e\u0433\u043e\u0432\u043e\u0440', blank=True, to='clients.Agreement', null=True)),
                ('author', models.ForeignKey(verbose_name='\u0410\u0432\u0442\u043e\u0440', to=settings.AUTH_USER_MODEL, null=True)),
                ('client', models.ForeignKey(related_name='operations', verbose_name='\u041a\u043b\u0438\u0435\u043d\u0442', to='clients.Client', null=True)),
            ],
            options={
                'verbose_name': '\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043e \u0441\u0447\u0435\u0442\u043e\u043c',
                'verbose_name_plural': '\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e \u0441\u0447\u0435\u0442\u043e\u043c',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('amount', models.IntegerField(verbose_name='\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c')),
                ('created', models.DateField(auto_now_add=True, verbose_name='\u0414\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f')),
            ],
            options={
                'verbose_name': '\u0426\u0435\u043d\u0430 \u043d\u0430 \u0443\u0441\u043b\u0443\u0433\u0443',
                'verbose_name_plural': '\u0426\u0435\u043d\u044b \u043d\u0430 \u0443\u0441\u043b\u0443\u0433\u0438',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('status', models.CharField(max_length=6, verbose_name='\u0421\u0442\u0430\u0442\u0443\u0441', choices=[('ACTIVE', '\u0410\u043a\u0442\u0438\u0432\u043d\u0430'), ('M_BLCK', '\u0420\u0443\u0447\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430'), ('F_BLCK', '\u0424\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430')])),
                ('price', models.IntegerField(verbose_name='\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c')),
                ('code_connect', models.TextField(verbose_name='\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435')),
                ('code_disconnect', models.TextField(verbose_name='\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435')),
                ('code_block', models.TextField(verbose_name='\u0411\u043b\u043e\u043a')),
                ('code_activate', models.TextField(verbose_name='\u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f')),
                ('agreement', models.ForeignKey(related_name='services', verbose_name='\u0414\u043e\u0433\u043e\u0432\u043e\u0440', to='clients.Agreement')),
                ('client', models.ForeignKey(related_name='services', verbose_name='\u041a\u043b\u0438\u0435\u043d\u0442', to='clients.Client')),
                ('connection_type', models.ForeignKey(verbose_name='\u0422\u0438\u043f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f', to='clients.ConnectionType', null=True)),
            ],
            options={
                'verbose_name': '\u0423\u0441\u043b\u0443\u0433\u0430',
                'verbose_name_plural': '\u0423\u0441\u043b\u0443\u0433\u0438',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ServiceChange',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('field', models.CharField(max_length=255)),
                ('value', models.CharField(max_length=255)),
                ('old', models.CharField(max_length=255, null=True)),
            ],
            options={
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ServiceChangeset',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('date', models.DateTimeField()),
                ('initial', models.BooleanField(default=0)),
                ('author', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
                ('service', models.ForeignKey(related_name='changesets', to='clients.Service')),
            ],
            options={
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ServiceTemplate',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=256, verbose_name='\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435')),
                ('type', models.CharField(max_length=1, verbose_name='\u0422\u0438\u043f', choices=[(b'P', '\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f'), (b'T', '\u0412\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f')])),
            ],
            options={
                'verbose_name': '\u0428\u0430\u0431\u043b\u043e\u043d \u0443\u0441\u043b\u0443\u0433\u0438',
                'verbose_name_plural': '\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0443\u0441\u043b\u0443\u0433',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='Zone',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=256, verbose_name='\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435')),
            ],
            options={
                'verbose_name': '\u0417\u043e\u043d\u0430',
                'verbose_name_plural': '\u0417\u043e\u043d\u044b',
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='servicechange',
            name='changeset',
            field=models.ForeignKey(related_name='changes', to='clients.ServiceChangeset'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='service',
            name='template',
            field=models.ForeignKey(verbose_name='\u0428\u0430\u0431\u043b\u043e\u043d \u0443\u0441\u043b\u0443\u0433\u0438', to='clients.ServiceTemplate'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='service',
            name='zone',
            field=models.ForeignKey(verbose_name='\u0417\u043e\u043d\u0430', to='clients.Zone'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='price',
            name='service',
            field=models.ForeignKey(verbose_name='\u0428\u0430\u0431\u043b\u043e\u043d \u0443\u0441\u043b\u0443\u0433\u0438', to='clients.ServiceTemplate'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='price',
            name='zone',
            field=models.ForeignKey(verbose_name='\u0417\u043e\u043d\u0430', to='clients.Zone'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='agreement',
            name='client',
            field=models.ForeignKey(related_name='agreements', verbose_name='\u041a\u043b\u0438\u0435\u043d\u0442', to='clients.Client'),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='agreement',
            name='zone',
            field=models.ForeignKey(verbose_name='\u0417\u043e\u043d\u0430', to='clients.Zone'),
            preserve_default=True,
        ),
    ]
